Skip to content

Comments

feat: Add deprecation warning for Vision API#2469

Merged
mallpunk merged 10 commits intomasterfrom
mallpunk/vision-deprecation-warning
Feb 20, 2026
Merged

feat: Add deprecation warning for Vision API#2469
mallpunk merged 10 commits intomasterfrom
mallpunk/vision-deprecation-warning

Conversation

@mallpunk
Copy link
Contributor

@mallpunk mallpunk commented Feb 13, 2026

Added deprecation warning for Vision API.

Ref https://docs.cognite.com/cdf/deprecated#deprecated-and-retired-features

@gemini-code-assist
Copy link
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.86%. Comparing base (e2f06c0) to head (c9b4f9b).
⚠️ Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
cognite/client/_api/vision.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2469   +/-   ##
=======================================
  Coverage   48.86%   48.86%           
=======================================
  Files         191      191           
  Lines       26152    26161    +9     
=======================================
+ Hits        12778    12783    +5     
- Misses      13374    13378    +4     
Files with missing lines Coverage Δ
cognite/client/_api/vision.py 56.09% <60.00%> (+0.54%) ⬆️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mallpunk mallpunk changed the title DRAFT deprecation warning for Vision API feat: DRAFT deprecation warning for Vision API Feb 13, 2026
@mallpunk
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a deprecation warning for the Vision API. The changes are well-structured, including updates to the code to raise a warning, modifications to the documentation to reflect the deprecation, and new tests to verify the warning is emitted correctly. I have a few suggestions to align the code with the style guide and improve the implementation of the warning.

@mallpunk mallpunk changed the title feat: DRAFT deprecation warning for Vision API feat: Add deprecation warning for Vision API Feb 18, 2026
@mallpunk mallpunk marked this pull request as ready for review February 18, 2026 09:52
@mallpunk mallpunk requested review from a team as code owners February 18, 2026 09:52
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @mallpunk, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a deprecation warning for the Vision API across the SDK and its associated documentation. The primary goal is to proactively inform users about the API's planned removal in a future version, guiding them towards recommended alternatives and ensuring a smooth transition for any existing integrations.

Highlights

  • Deprecation Warning Implementation: A new static method _deprecation_warning was added to the VisionAPI class to issue a FutureWarning regarding the Vision API's upcoming removal. This warning is now triggered when calling the extract and get_extract_job methods.
  • Documentation Updates: The documentation was updated to reflect the deprecation. A warning block was added to the contextualization.rst file, and the extract and get_extract_job methods of the Vision API were explicitly listed as deprecated in deprecated.rst.
  • Testing for Deprecation: New unit tests were introduced to verify that the FutureWarning is correctly emitted when the deprecated extract and get_extract_job methods are invoked. Additionally, pytest.ini was updated to ignore FutureWarning from the cognite.client module during tests.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • cognite/client/_api/vision.py
    • Added a static method _deprecation_warning to issue a FutureWarning.
    • Integrated the _deprecation_warning call into the extract and get_extract_job methods.
  • docs/source/contextualization.rst
    • Added a reStructuredText warning directive to the Vision API section, notifying users of its deprecation.
  • docs/source/deprecated.rst
    • Included the Vision API's extract and get_extract_job methods in the deprecated features documentation.
  • pytest.ini
    • Configured pytest to ignore FutureWarning originating from the cognite.client module.
  • tests/tests_unit/test_api/test_vision_extract.py
    • Added new test cases test_extract_emits_deprecation_warning and test_get_extract_job_emits_deprecation_warning to assert FutureWarning is raised.
    • Refactored variable VAPI to vision_api for improved readability and consistency.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively adds a deprecation warning for the Vision API, which is a necessary step for API lifecycle management. The changes include adding FutureWarning to the relevant API methods, updating the documentation to reflect the deprecation, and adding tests to ensure the warnings are correctly triggered. The implementation is solid. I have one suggestion to improve the developer experience by adjusting the stacklevel of the warning to point directly to the user's code.

haakonvt
haakonvt previously approved these changes Feb 18, 2026
Copy link
Contributor

@haakonvt haakonvt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one suggestion

Vision
------

.. warning::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could also do something like this to really make it stand out?

Vision (deprecated)
-------------------
Image

Copy link
Contributor

@haakonvt haakonvt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@haakonvt haakonvt added the waiting-for-risk-review Waiting for a member of the risk review team to take an action label Feb 18, 2026
@einarmo einarmo self-assigned this Feb 19, 2026
@einarmo einarmo added the risk-review-ongoing Risk review is in progress label Feb 19, 2026
@einarmo
Copy link
Contributor

einarmo commented Feb 19, 2026

🦄

@einarmo einarmo removed the waiting-for-risk-review Waiting for a member of the risk review team to take an action label Feb 19, 2026
@einarmo einarmo added the waiting-for-team Waiting for the submitter or reviewer of the PR to take an action label Feb 19, 2026
@mallpunk mallpunk added this pull request to the merge queue Feb 20, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 20, 2026
@mallpunk mallpunk added this pull request to the merge queue Feb 20, 2026
Merged via the queue into master with commit ea1b662 Feb 20, 2026
18 checks passed
@mallpunk mallpunk deleted the mallpunk/vision-deprecation-warning branch February 20, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk-review-ongoing Risk review is in progress waiting-for-team Waiting for the submitter or reviewer of the PR to take an action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants